﻿Public Class Libro : Implements IEquatable(Of Libro)

    Public Property Isbn As String
    Public Property CodCategoria As Integer
    Public Property CodSoporte As Integer
    Public Property Titulo As String
    Public Property Ejemplares As Integer
    Public Property CodAutor As List(Of String)

    Public Sub New()

    End Sub

    Public Sub New(isbn As String, codcategoria As Integer, codsoporte As Integer, titulo As String, ejemplares As Integer)
        Me.Isbn = isbn
        Me.CodCategoria = codcategoria
        Me.CodSoporte = codsoporte
        Me.Titulo = titulo
        Me.Ejemplares = ejemplares

    End Sub

    Public Sub New(isbn As String, misoporte As Soporte, micategoria As Categoria, titulo As String, ejemplares As Integer)
        Me.Isbn = isbn
        Me.CodCategoria = micategoria.CodCategoria
        Me.CodSoporte = misoporte.CodSoporte
        Me.Titulo = titulo
        Me.Ejemplares = ejemplares

    End Sub

    Public Sub New(isbn As String, codcategoria As Integer, codsoporte As Integer, titulo As String, ejemplares As Integer, codautor As List(Of String))
        Me.Isbn = isbn
        Me.CodCategoria = codcategoria
        Me.CodSoporte = codsoporte
        Me.Titulo = titulo
        Me.Ejemplares = ejemplares
        Me.CodAutor = codautor
    End Sub

    Public Function Equals1(other As Libro) As Boolean Implements IEquatable(Of Libro).Equals
        Return Me.Isbn = other.Isbn
    End Function
    Public Overrides Function ToString() As String
        Return Me.Titulo & " -> " & Me.Ejemplares & " -> " & Me.CodCategoria
    End Function
End Class
